import 'package:mobx/mobx.dart';
import 'package:flutter_template/domain/counter/counter.dart';
import 'package:flutter_template/application/counter/counter_use_case.dart';
import 'package:injectable/injectable.dart';

part 'counter_store.g.dart';

@injectable
class CounterStore = _CounterStore with _$CounterStore;

abstract class _CounterStore with Store {
  final CounterUseCase _useCase;

  _CounterStore(this._useCase);

  @observable
  Counter counter = Counter(0);

  @action
  Future<void> loadCounter() async {
    // counter = await _useCase.getCounter();
  }

  @action
  Future<void> increment() async {
    counter = await _useCase.incrementCounter(counter);
    // loadCounter();
  }

  @action
  Future<void> decrement() async {
    await _useCase.decrementCounter(counter);
    // loadCounter();
  }
} 